<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="java.util.List"%>
<%@page import="cn.company.bean.Module"%>
<%@page import="cn.company.database.DBUtils"%>
<%@page import="cn.company.bean.Sort"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>后台管理—分类管理</title>
<%
	String id = request.getParameter("id");
	String path = request.getContextPath();
	List<Module> modules = DBUtils.getModules();
	Sort sorts = DBUtils.getSortById(Integer.parseInt(id));
%>
</head>
<body>
<div id="mainDiv">
		<c:import url="../public/top.jsp" />
		<div id="centerDiv">
			<c:import url="../public/navigation.jsp"></c:import>
			<div id="right"> 
				<div id="current">&nbsp;&nbsp;&nbsp;&nbsp;当前位置: 修改分类管理</div>
				<div id="form">
					<P>&nbsp;</P>
					<form action="<%=path %>/OurHomeControlServlet" method="post">
						<input type="hidden" name="action" value="updateSort" />
						<input type="hidden" name="id" id="id" value="<%=id %>" />
						分类名称：<input type="text" name="sortname" value="<%= sorts.getSortName() %>">
						所属模块：
						<select name="module">
							<%
								for(int i = 0;i < modules.size();i++){
							%>
									<option value="<%=modules.get(i).getId() %>" <%if (modules.get(i).getId()==sorts.getModuleId()){%>selected="selected"<%} %>><%=modules.get(i).getName() %></option>
							<%
								}
							%>
						</select>
						<input type="submit" value="修改内容"></input>
					</form>
				</div>
			</div>
		</div>
		<div id="bottomDiv"></div>
	</div>
	<script language="javascript">
		$("#test1").toggle(function(){$("#test").slideDown();},function(){$("#test").slideUp();});
	</script>
</body>
</html>